import java.time.LocalDate;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-26
 * Time: 15:33
 */
public class tets2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            LocalDate head = LocalDate.of(sc.nextInt(),sc.nextInt(),sc.nextInt());
            LocalDate tail = LocalDate.of(sc.nextInt(),sc.nextInt(),sc.nextInt());
            int num=0;
            while (head.compareTo(tail)<=0){
                int month = head.getMonthValue();
                if(month == 2 ||  month==3 || month == 5 ||  month == 7 ||  month ==11){
                    num+=1;
                }else {
                    num+=2;
                }
                head=head.plusDays(1);
            }
            System.out.println(num);
        }
    }
}
